<? // cvs version ?>
<? include("config.inc.php"); ?>
<? require ("conf_func.php"); ?>
<? include("get_conf.inc.php"); ?>

<html>
<head>
<title>ezBOO WebStats</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.titre3 { font-family: Arial, Helvetica, sans-serif; font-size: 14pt}
-->
</style>
<link rel="stylesheet" href="style1.css">
</head>

<body bgcolor="#FFFFFF">
<span class="titre3"></span>
<table width="760" border="1" cellspacing="0" cellpadding="2" bordercolor="#636563" class="normal">
  <tr bordercolor="#666666">
    <!--<td height="60" valign="middle" align="center"><a href="index.php"><img src="image/logo_ez1.gif" width="200" height="40" border="0"></a></td> -->
    <td colspan="2" bgcolor="#666666" class="titre" height="60">
      <div align="center" class="titre"><font color="#FFFFFF">&gt;&gt;<a href="index.php">
        <font color="#FFFFFF"><? echo $msgAdminPanel ?> </font></a>&lt;&lt; </font></div>
    </td>
  </tr>
  <tr bordercolor="#FFFFFF">
    <td colspan="3" bordercolor="#666666" height="200" class="normal">
      <p align="right"><?
function AL_Date( ) {
  Global $msgDaysArray;
  Global $msgMonthsArray;
  echo $msgDaysArray[date("w")] ." ";
  echo date("j")." ";
  echo $msgMonthsArray[date("n")-1]." ".date("Y");
}

AL_Date( );
?> </p>

      <table width="600" border="0" cellspacing="2" cellpadding="4" align="center" class="normal">
        <tr bgcolor="#CCCCCC">
          <td class="titre2" colspan="2"><? echo $msgDBInformation ?></td>
        </tr>
      </table>

<?php
 global $server;
 global $user;
 global $password;
 global $base;


 $c = mysql_connect("$server","$user","$password") or die($msgSqlConnectImpossible);
 $ddb = mysql_select_db("$base") or die($msgBaseConnectImpossible);

$i=0;
while ($bar=each($sites)) {
$i=$i+1;
 $cur_table = $bar[0];
 // Get number of months in table
 $result = mysql_query ("select count(distinct(month(date))) from $cur_table");
 $row = mysql_fetch_array($result);
 $number_months = $row[0];

 // Get size of table
 $result = mysql_query ("show table status like '$cur_table'");
 $row = mysql_fetch_array($result);
 $number_line = $row['Rows'];      // Get number of lines in tables
 $table_size = ($row['Data_length'] + $row['Index_length'])/1024;
 // print_r($row);


?>
      <form name="<? echo "form_site$i"; ?>" action="archive.php" method="post" >
      <input type="hidden" name="<? echo "table_log" ?>" value="<? echo $bar[0] ?>">
        <table width="460" border="0" cellspacing="2" cellpadding="4" align="center" class="normal">
          <tr class="titre3" bgcolor="#CCCCCC">
            <td width="327" class="titre3"><? echo "$msgTable:  $bar[0]"; ?></td>
            <td width="111">&nbsp;</td>
          </tr>
          <tr>
            <td bgcolor="#FFFFCC" width="327">
              <div align="right"><? echo $msgLineNbr ?></div>
            </td>
            <td width="111" bgcolor="#FFFFCC"><? echo $number_line; ?></td>
          </tr>
          <tr>
            <td width="327" bgcolor="#CCCCFF" height="23">
              <div align="right"><? echo $msgNbrSavedMonths ?></div>
            </td>
            <td width="111" bgcolor="#CCCCFF" height="23"><? echo $number_months; ?></td>
          </tr>
          <tr>
            <td bgcolor="#FFFFCC" width="327">
              <div align="right"><? echo $msgTableSize ?></div>
            </td>
            <td width="111" bgcolor="#FFFFCC"><? echo number_format($table_size,0); ?> kB</td>
          </tr>
          <tr bgcolor="#CCCCFF">
            <td width="327">
              <div align="right" class="normal"><? echo $msgArchiveTableKeepLast ?>
                <input type="text" name="month_kept" size="2" value="1">
                <? echo $msgMonth ?></div>
            </td>
            <td width="111">
              <div align="center">
                <input type="submit" name="<? echo "Archive$i"; ?>" value="<? echo $msgArchive ?>">
              </div>
            </td>
          </tr>
        </table>
      </form>
<?
// End of the While loop
} ?>




      <p>&nbsp;</p>

      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p><?php

function GetCheckBoxValue($BoxName) {
 global $config_table;
 $result = mysql_query ("SELECT value FROM $config_table where variable='$BoxName'");
 while($row = mysql_fetch_array($result)) {   if ($row[0]==1) echo "checked" ; }
}


?></p>
      <form name="form1" action="config_update.php" method="post" >
        <table width="600" border="0" cellspacing="2" cellpadding="4" align="center" class="normal">
          <tr bgcolor="#CCCCCC">
            <td colspan="4" class="titre2"><? echo $msgDisplay ?></td>
          </tr>
        </table>
        <table width="460" border="0" cellspacing="2" cellpadding="4" align="center" class="normal">
          <tr>
            <td width="207">&nbsp;</td>
            <td colspan="3" bgcolor="#CCCCCC">
              <div align="center"><b><? echo $msgOrderBy ?></b></div>
              <div align="center"></div>
            </td>
          </tr>
          <tr>
            <td width="207" bgcolor="#CCCCCC">
              <div align="left"><b><? echo $msgDisplay2 ?></b></div>
            </td>
            <td width="50" bgcolor="#CCCCCC">
              <div align="center"><? echo $msgDay ?></div>
            </td>
            <td width="50" bgcolor="#CCCCCC">
              <div align="center"><? echo $msgWeek ?></div>
            </td>
            <td width="50" bgcolor="#CCCCCC">
              <div align="center"><? echo $msgMonth ?></div>
            </td>
          </tr>
          <tr>
            <td width="207" bgcolor="#CCCCFF">
              <p align="right"><? echo $msgHours ?></p>
            </td>
            <td width="50" bgcolor="#CCCCFF">
              <div align="center">
                <p>
                  <input type="checkbox" name="d_show_hour" value="d_show_hour"


<?php GetCheckBoxValue("d_show_hour"); ?>



>
                </p>
              </div>
            </td>
            <td width="50" bgcolor="#CCCCFF">
              <div align="center"> </div>
            </td>
            <td width="50" bgcolor="#CCCCFF">
              <div align="center"> </div>
            </td>
          </tr>
          <tr bgcolor="#FFFFCC">
            <td width="207">
              <div align="right"><? echo $msgDay ?></div>
            </td>
            <td width="50">&nbsp;</td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="w_show_day" value="w_show_day" <?php GetCheckBoxValue("w_show_day"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="m_show_day" value="m_show_day" <?php GetCheckBoxValue("m_show_day"); ?>>
              </div>
            </td>
          </tr>
          <tr bgcolor="#CCCCFF">
            <td width="207">
              <div align="right"><? echo $msgMonth ?></div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="d_show_month" value="d_show_month" <?php GetCheckBoxValue("d_show_month"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="w_show_month" value="w_show_month" <?php GetCheckBoxValue("w_show_month"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="m_show_month" value="m_show_month" <?php GetCheckBoxValue("m_show_month"); ?>>
              </div>
            </td>
          </tr>
          <tr bgcolor="#FFFFCC">
            <td width="207">
              <div align="right"><? echo $msgCountry ?></div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="d_show_country" value="d_show_country" <?php GetCheckBoxValue("d_show_country"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="w_show_country" value="w_show_country" <?php GetCheckBoxValue("w_show_country"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="m_show_country" value="m_show_country" <?php GetCheckBoxValue("m_show_country"); ?>>
              </div>
            </td>
          </tr>
          <tr bgcolor="#CCCCFF">
            <td width="207">
              <div align="right" bgcolor="#CCCCFF"><? echo $msgOS ?></div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="d_show_os" value="d_show_os" <?php GetCheckBoxValue("d_show_os"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="w_show_os" value="w_show_os" <?php GetCheckBoxValue("w_show_os"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="m_show_os" value="m_show_os" <?php GetCheckBoxValue("m_show_os"); ?>>
              </div>
            </td>
          </tr>
          <tr bgcolor="#FFFFCC">
            <td width="207">
              <div align="right"><? echo $msgBrowser ?></div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="d_show_browser" value="d_show_browser" <?php GetCheckBoxValue("d_show_browser"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="w_show_browser" value="w_show_browser" <?php GetCheckBoxValue("w_show_browser"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="m_show_browser" value="m_show_browser" <?php GetCheckBoxValue("m_show_browser"); ?>>
              </div>
            </td>
          </tr>
          <tr bgcolor="#CCCCFF">
            <td width="207">
              <div align="right" bgcolor="#CCCCFF"><? echo $msgRequestPage ?></div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="d_show_reqpage" value="d_show_reqpage" <?php GetCheckBoxValue("d_show_reqpage"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="w_show_reqpage" value="w_show_reqpage" <?php GetCheckBoxValue("w_show_reqpage"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="m_show_reqpage" value="m_show_reqpage" <?php GetCheckBoxValue("m_show_reqpage"); ?>>
              </div>
            </td>
          </tr>
          <tr bgcolor="#FFFFCC">
            <td width="207">
              <div align="right"><? echo $msgReferer ?></div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="d_show_referer" value="d_show_referer" <?php GetCheckBoxValue("d_show_referer"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="w_show_referer" value="w_show_referer" <?php GetCheckBoxValue("w_show_referer"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="m_show_referer" value="m_show_referer" <?php GetCheckBoxValue("m_show_referer"); ?>>
              </div>
            </td>
          </tr>
          <tr bgcolor="#CCCCFF">
            <td width="207">
              <div align="right" bgcolor="#CCCCFF"><? echo $msgProvider ?></div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="d_show_provider" value="d_show_provider" <?php GetCheckBoxValue("d_show_provider"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="w_show_provider" value="w_show_provider" <?php GetCheckBoxValue("w_show_provider"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF">
                <input type="checkbox" name="m_show_provider" value="m_show_provider" <?php GetCheckBoxValue("m_show_provider"); ?>>
              </div>
            </td>
          </tr>
          <tr bgcolor="#FFFFCC">
            <td width="207">
              <div align="right"><? echo $msgGraph ?></div>
            </td>
            <td width="50">
              <div align="center">
                <input type="checkbox" name="d_show_hourgraph" value="d_show_hourgraph" <?php GetCheckBoxValue("d_show_hourgraph"); ?>>
              </div>
            </td>
            <td width="50">
              <div align="center"></div>
            </td>
            <td width="50">
              <div align="center"></div>
            </td>
          </tr>
          <tr bgcolor="#CCCCFF">
            <td bgcolor="#CCCCFF" width="207">&nbsp;</td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF"></div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF"></div>
            </td>
            <td width="50">
              <div align="center" bgcolor="#CCCCFF"></div>
            </td>
          </tr>
        </table>
        <br>
        <table width="460" border="0" cellspacing="2" cellpadding="4" align="center" class="normal">
          <tr>
            <td width="112" bgcolor="#CCCCFF">
              <div align="right"><? echo $msg_lang_filename ?></div>
            </td>
            <td width="326" bgcolor="#CCCCFF">
              <p>






  <select name="lang">
    <option selected>
        <?php
         $result = mysql_query ("SELECT value FROM $config_table where variable='lang'");
         while($row = mysql_fetch_array($result)) {
           echo $row[0];
        }
        ?>
    </option>

    <? while ($bar=each($lang_files)) {$i=$i+1; echo "<option>$bar[1]</option>";} ?>

  </select>












              </p>
            </td>
          </tr>
          <tr>
            <td width="112" bgcolor="#FFFFCC">
              <div align="right"><? echo $msgURLtrucate ?></div>
            </td>
            <td width="326" bgcolor="#FFFFCC">
              <input type="text" name="url_trunc_size" value="<?php
 $result = mysql_query ("SELECT value FROM $config_table where variable='url_trunc_size'");
 while($row = mysql_fetch_array($result)) {
   echo $row[0];
}


?>" size="3">
            </td>
          </tr>
          <tr>
            <td width="112" bgcolor="#CCCCFF">
              <div align="right"><? echo $msgBrowserList ?></div>
            </td>
            <td width="326" bgcolor="#CCCCFF">
              <textarea name="browser_list" cols="34" rows="10"><?php
 $result = mysql_query ("SELECT value FROM $config_table where variable='browser_list'");
 while($row = mysql_fetch_array($result)) {
   echo $row[0];
}
?>
</textarea>
            </td>
          </tr>
          <tr>
            <td bgcolor="#FFFFCC" width="112">
              <div align="right"><? echo $msgOSList ?></div>
            </td>
            <td width="326" bgcolor="#FFFFCC">
              <textarea name="os_list" cols="34" rows="10"><?php
 $result = mysql_query ("SELECT value FROM $config_table where variable='os_list'");
 while($row = mysql_fetch_array($result)) {
   echo $row[0];
}
?>
</textarea>
            </td>
          </tr>
          <tr>
            <td bgcolor="#CCCCFF" width="112">&nbsp;</td>
            <td width="326" bgcolor="#CCCCFF">&nbsp; </td>
          </tr>
          <tr>
            <td bgcolor="#FFFFCC" width="112">&nbsp;</td>
            <td width="326" bgcolor="#FFFFCC">&nbsp;</td>
          </tr>
          <tr>
            <td width="112" bgcolor="#CCCCFF">&nbsp;</td>
            <td width="326" bgcolor="#CCCCFF">&nbsp;</td>
          </tr>
          <tr>
            <td bgcolor="#FFFFCC" width="112">&nbsp;</td>
            <td width="326" bgcolor="#FFFFCC">&nbsp;</td>
          </tr>
        </table>
        <br>
        <table width="460" border="0" align="center">
          <tr>
            <td width="220">
              <div align="center">
                <input type="submit" name="Submit" value="        Ok        ">
              </div>
            </td>
            <td width="220">
              <div align="center">
                <input type="reset" name="Cancel" value="   <? echo $msgCancel ?>   ">
              </div>
            </td>
          </tr>
        </table>
        </form>
      <p>&nbsp;</p>
     <!-- <p align="center" class="verysmall"><a href="http://www.ezboo.com" target="_blank"><img src="image/logo_webstats.gif" width="100" height="40" border="0"></a><br>
        <? echo $msgStatBy ?> <a href="http://www.ezboo.com" target="_blank">ezBOO</a>
        <? echo $msgVersion ?></p>
-->
      </td>
  </tr>
</table>
<p class="verysmall">&nbsp;</p>
</body>
</html>

<?php
 mysql_free_result ($result);
 mysql_close ($c);        // close sql connection
?>